gdkwindow-wayland: Bail out early if we get a frame callback when destroying our...
authorJasper St. Pierre <jstpierre@mecheye.net>
Fri, 31 Jan 2014 21:24:19 +0000 (16:24 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Fri, 31 Jan 2014 21:25:27 +0000 (16:25 -0500)
This prevents warnings like

(gtk3-demo:14948): Gdk-CRITICAL **: _gdk_frame_clock_thaw: assertion 'GDK_IS_FRAME_CLOCK (clock)' failed

(gtk3-demo:14948): Gdk-CRITICAL **: gdk_frame_clock_get_timings: assertion 'GDK_IS_FRAME_CLOCK (frame_clock)' failed

We need to do this, as the compositor might have already sent us a frame
event, in-flight, at the same time we destroy our window. In this case, we'll
receive the then-in-flight "done" event, and then warn as we try to look
up the frame clock on a destroyed window.

gdk/wayland/gdkwindow-wayland.c

index 13293bd4d6e945529f9500a7f0dcd029ca1f292d..ec51f590a78762cb3dccbd4f44c1c08659ab2844 100644 (file)
@@ -403,6 +403,10 @@ on_frame_clock_after_paint (GdkFrameClock *clock,
     return;
 
   impl->pending_commit = FALSE;
+
+  if (GDK_WINDOW_DESTROYED (window))
+    return;
+
   impl->pending_frame_counter = gdk_frame_clock_get_frame_counter (clock);
 
   callback = wl_surface_frame (impl->surface);